THIS KNOWLEDGE BASE HAS BEEN ARCHIVED AND IS NO LONGER BEING UPDATED
Please visit library.nagios.com/docs for the latest and most up-to-date documentation.
Home » Categories » Multiple Categories

Nagios XI - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"

Problem Description

After uploading a plugin (check_apc_pdu_load.sh for example), the following error is produced:

The following error message is produced:

-bash: ./check_apc_pdu_load.sh: /bin/bash^M: bad interpreter: No such file or directory

This is caused by the file being in a "Windows" format instead of a "Unix" format. It has to do with the line endings / carriage returns.

 

Resolving The Problem

To resolve the problem you will convert the file to a Unix format. Execute the following steps from an SSH session as a user with root privileges.

The first step is to install the required package:

RHEL | CentOS | Oracle Linux

yum install -y dos2unix

 

Debian | Ubuntu

apt-get install -y dos2unix

 

The next step is to convert the file to a Unix format:

dos2unix /usr/local/nagios/libexec/check_apc_pdu_load.sh


This will output:

dos2unix: converting file /usr/local/nagios/libexec/check_apc_pdu_load.sh to UNIX format ...

 

After completing these steps the plugin should execute as intended.

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

1 (6)
Article Rating (6 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - MSSQL Wizards - Adaptive Server connection failed
Viewed 14379 times since Thu, Aug 3, 2017
Nagios XI - MSSQL Query Wizard - Invalid characters in the username
Viewed 7437 times since Thu, Aug 3, 2017
Nagios XI - CentOS 6 Installation Problems XI 2011R1.7 2011R1.8
Viewed 6816 times since Tue, Feb 2, 2016
Nagios XI - Downloading A System Profile
Viewed 10738 times since Wed, Jul 19, 2017
Nagios XI - Host Still Visible After Deletion (Ghost Hosts)
Viewed 14848 times since Tue, Jan 27, 2015
Nagios XI - Windows Memory Usage - Physical
Viewed 21308 times since Tue, Jan 26, 2016
OpenSSL causes issue with check_nrpe plugin with NSClient++
Viewed 14923 times since Fri, Apr 30, 2021
Nagios Core - How to Think with Nagios to Solve Monitoring Problems - NWC14
Viewed 9545 times since Mon, Feb 8, 2016
Nagios XI - Apply Configuration Never Completes
Viewed 26095 times since Tue, Jan 27, 2015
Nagios XI - ERROR: unable to open include file: /etc/mrtg/conf.d/xxxxxxx.cfg
Viewed 10994 times since Wed, Jun 1, 2016